<template>
  <div>
    <NuxtLayout>
      <NuxtPage />
    </NuxtLayout>
    
    <!-- 全局 Toast 组件 -->
    <Toast 
      :message="$toastState.message"
      :type="$toastState.type"
      :timeout="$toastState.timeout"
      v-model:show="$toastState.show"
    />
  </div>
</template>

<script setup>
import { onMounted, watch } from "vue";
import { useI18n } from "vue-i18n";
import { useLocale } from "vuetify";

import "~/assets/main.scss";
import "~/assets/animate.min.css";

import '~/@core/scss/template/index.scss'
import '~/@layouts/styles/index.scss'
// 字体样式，需要放在这里载入
import "remixicon/fonts/remixicon.css"; 
// 暂不使用mdi图标
// import '@mdi/font/css/materialdesignicons.css'
// 自定义样式
import "~/assets/styles/styles.scss";

const { locale } = useI18n();
const { current: vuetify } = useLocale();
const { $toastState } = useNuxtApp()

watch(locale, (newLocale) => {
  // 同步更新 Vuetify 的语言
  vuetify.value = newLocale;
});

onMounted(() => {
  // console.log('app mounted');
});
</script>
